package aapilast1;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        String name = main.getName();
        System.out.println(name);

        long id = main.getId();
        System.out.println("id:" + id);

        int priority = main.getPriority();
        System.out.println("优先级:" + priority);

        boolean isAlive = main.isAlive();
        System.out.println("是否存活:" + isAlive);

        boolean isDaemon = main.isDaemon();
        System.out.println("是否守护线程:" + isDaemon);

        boolean isInterrupted = main.isInterrupted();
        System.out.println("是否被中断:" + isInterrupted);
    }
}
